import java.util.ArrayList;
import java.util.HashMap;

import utils.Category;
import utils.Review;
import utils.ReviewFileParser;
import domainedvd.DVDProximite;
import evaluation.Evaluateur;


public class MainPierre {

	public static void main(String[] args) {
		try {
								
			Category cat = Category.DVD;
			
			ReviewFileParser parser = new ReviewFileParser(); 
			ArrayList<Review> revTrain = parser.getTrainingReviews(args[0], Category.BOOKS);
			revTrain.addAll(parser.getTrainingReviews(args[0], Category.ELECTRONICS));
			revTrain.addAll(parser.getTrainingReviews(args[0], Category.KITCHEN));
			ArrayList<Review> revDev = parser.getDevReviews(args[0], cat);
			ArrayList<Review> revUnlab = parser.getUnlabReviews(args[0], cat);
			ArrayList<Review> revTest = parser.getTestReviews(args[0], cat);
			

//			DVDSupervise classifieur =
//				new DVDSupervise(revTrain, StopWords.NONE, 2.d, 1.d);
			DVDProximite classifieur =
				new DVDProximite(revUnlab, revTrain, 1.d, 70);

//			System.out.println("class dev");
			HashMap<Integer, Boolean> classification = 
				classifieur.classifier(revDev);

			Evaluateur eval = new Evaluateur();
			
			eval.evaluer(revTest, classification);
//			System.out.println("class test");
//			HashMap<Integer, Boolean> classification1 = classifieur.classifier(revTest);
				
			eval.printResults(revTest, classification);
	} catch(Exception e) {
		e.printStackTrace();
	}
}
}
